{% extends 'base.html' %}
{% block head %}
    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>登记信息</title>
    <link rel="icon" href="{{ url_for('static', filename='images/favicon.ico') }}">
    <link rel="stylesheet" href="{{ url_for('static', filename='css/style.css') }}" type="text/css">
{% endblock %}
{% block content %}
<div class="form-container">
        <h2>学生基本信息</h2>
        <form id="studentForm" method="post" action={{ url_for("saveStudentInfo") }}>
            <div class="form-group">
                <label for="studentName">学生姓名:</label>
                <input type="text" id="studentName" name="studentName" required>
            </div>
            <div class="form-group">
                <label for="examScore">中考分数:</label>
                <input type="number" id="examScore" step="any" name="examScore" min="0" max="750" required>
            </div>
            <div class="form-group">
                <label for="schoolName">生源学校:</label>
                <input type="text" id="schoolName" name="schoolName" required>
            </div>
            <div class="form-group">
                <label for="phoneNumber">联系电话:</label>
                <input type="text" id="phoneNumber" name="phoneNumber" maxlength="11" >
            </div>
            <div class="form-group">
                <label for="registerTeacher">登记老师:</label>
                <input type="text" id="registerTeacher" name="registerTeacher" required>
            </div>
            <button type="submit">生成志愿</button>
        </form>
    </div>
<script>
document.getElementById('phoneNumber').addEventListener('input', function(e) {
    let value = e.target.value;
    value = value.replace(/\D/g, '');
    if (value.length > 11) {
        value = value.substr(0, 11);
    }
    e.target.value = value;
});  
</script>



{% endblock %}
